package com.book.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.book.common.annotation.group.InsertGroup;
import com.book.common.annotation.group.UpdateGroup;
import com.book.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;

/**
 * @author Bigboss
 * @create 2024-10-19 19:59
 */
@ApiModel("轮播图")
@TableName("carousel")
public class Carousel extends BaseEntity {

    /**
     * 主键id
     */
    @ApiModelProperty("主键id")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 标题
     */
    @ApiModelProperty("标题")
    @NotBlank(message = "请输入标题",groups = {InsertGroup.class, UpdateGroup.class})
    private String title;


    /**
     * 图片地址
     */
    @ApiModelProperty("图片地址")
    @NotBlank(message = "请上传图片",groups = {InsertGroup.class, UpdateGroup.class})
    private String pic;


    /**
     * 链接地址
     */
    @ApiModelProperty("链接地址")
    private String url;


    /**
     * 排序
     */
    private Integer sort;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    @Override
    public String toString() {
        return "Carousel{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", pic='" + pic + '\'' +
                ", url='" + url + '\'' +
                ", sort=" + sort +
                '}';
    }
}
